package edu.nju.desserthouse.action.business;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;

public class VipBirthInfoBean implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private ArrayList<Double> birthNum = new ArrayList<Double>();
	private ArrayList<Double> birthRatio = new ArrayList<Double>();
	private ArrayList<Date> birthList = new ArrayList<Date>();
	
	public int getBirthSize(){
		return birthList.size();
	}
	
	public Date getBirth(int i){
		return birthList.get(i);
	}
	
	public double getBirthNum(int i){
		return birthNum.get(i);
	}
	
	public double getBirthRatio(int i){
		return birthRatio.get(i);
	}
	
	public void initBirthNumList(){
		birthList.add(Date.valueOf("1950-01-01"));
		birthList.add(Date.valueOf("1960-01-01"));
		birthList.add(Date.valueOf("1970-01-01"));
		birthList.add(Date.valueOf("1980-01-01"));
		birthList.add(Date.valueOf("1990-01-01"));
		birthList.add(Date.valueOf("2000-01-01"));
		for(int i = 0; i < birthList.size(); i++){
			birthNum.add(i, 0.0);
			birthRatio.add(i, 0.0);
		}
	}
	
	public void addToNum(int index){
		double value = birthNum.get(index);
		value++;
		birthNum.set(index, value);
	}
	
	public void setBirthList(ArrayList<Date> birthList){
		this.birthList = birthList;
	}
	
	public void setRatio(int index, double ratio){
		birthRatio.set(index, ratio);
	}
}
